package se.webbzon.boltzmann.editor.environment;

import se.webbzon.boltzmann.battle.property.BattlePropertyFactoryGroup;
import se.webbzon.boltzmann.environment.AbstractEnvironment;
import se.webbzon.boltzmann.game.object.spawner.HostileNPCSpawnerInflator;
import se.webbzon.boltzmann.inflatorgroup.DefaultInflatorGroup;
import se.webbzon.boltzmann.inflatorgroup.InflatorGroupException;

public class EditorInflatorGroup extends DefaultInflatorGroup {
	
	// The battle property factory group used to create battle properties
	private final BattlePropertyFactoryGroup bpfGroup;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public EditorInflatorGroup(BattlePropertyFactoryGroup bpfGroup) {
		this.bpfGroup = bpfGroup;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	@Override public void initialize(AbstractEnvironment env) throws Exception {
		if (!(env instanceof EditorEnvironment))
			throw new InflatorGroupException(	"The abstract environment must " +
												"be an instance of " + 
												"EdiorEnvironment.");
		EditorEnvironment eenv = (EditorEnvironment) env;
		super.initialize(eenv);
		
		addInflator(new HostileNPCSpawnerInflator(eenv,bpfGroup));
	}

}
